<?php
/**
 * @author Demianchuk Dmitro
 * @email d.demianchuk@gmail.com
 * @date 25.01.12
 * @version 1.0
 * @package application.components
 */
class WebUser extends CWebUser {
	private $_model = null;

	public function getRole() {
		if($user = $this->getModel()){
			return $user->role->name;
		}
	}

	private function getModel(){
		if (!$this->isGuest && $this->_model === null){
			$this->_model = User::model()->findByPk($this->id);
		}
		return $this->_model;
	}
}